package com.ikun.admin.modules.scheduled.init;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ikun.admin.modules.scheduled.entity.Task;
import com.ikun.admin.modules.scheduled.service.TaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * @ClassName ScheduledInitLineRunner
 * @Description:
 * @CreateDate: 2024/8/11 22:49
 */
@Component
@Slf4j
public class ScheduledInitLineRunner implements CommandLineRunner {

    @Autowired
    private TaskService taskService;

    @Override
    public void run(String... args) throws Exception {
        log.info("【定时任务初始化】-参数：" + Arrays.toString(args));
        List<Task> list = taskService.list(new QueryWrapper<Task>());
        if (list.size() == 0) {
            return;
        }
        list.forEach(task -> {

        });
    }
}
